﻿using GadgetStore.Data.Models;
using GadgetStore.Web.Adapters;
using GadgetStore.Web.Adapters.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace GadgetStore.Web.Controllers
{
    public class ApiEmailController : ApiController
    {
        private IEmail _adapter;
        public ApiEmailController()
        {
            _adapter = new EmailAdapter();
        }
        [HttpPost]
        public IHttpActionResult POST(Email email)
        {
            string sentNotice = _adapter.SendEmail(email);
            return Ok(sentNotice);
        }
    }
}
